package com.wjjun.databinding;

import android.databinding.BindingAdapter;
import android.support.v4.view.ViewPager;

import com.wjjun.presenter.TabViewPagerPresenter;

/**
 * ViewPager
 * Created by 67535 on 2018/5/10.
 */
public class ViewPagerAdapter {

    @BindingAdapter(value = {"bindPresenter"})
    public static void bindPresenter(ViewPager viewPager, TabViewPagerPresenter bindPresenter) {
        if (bindPresenter == null) {
            return;
        }
        bindPresenter.bindViewPager(viewPager);
    }

    @BindingAdapter(value = "cachePager")
    public static void setCachePager(ViewPager viewPager, int cachePager){
        viewPager.setOffscreenPageLimit(cachePager);
    }

}
